package com.ruoyi.system.api.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * 短信发送结果
 * 
 * @author ruoyi
 */
@Data
public class SmsResult implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 是否成功 */
    private Boolean success;

    /** 返回消息 */
    private String message;

    /** 状态码 */
    private String code;

    /** 手机号 */
    private String phoneNumber;

    /** 原始响应 */
    private String rawResponse;

    /** 验证码 */
    private String verificationCode;

    public static SmsResult ok(String phone, String msg, String verificationCode) {
        SmsResult r = new SmsResult();
        r.success = true;
        r.message = msg;
        r.code = "200";
        r.phoneNumber = phone;
        r.verificationCode = verificationCode;
        return r;
    }

    public static SmsResult fail(String phone, String msg, String raw) {
        SmsResult r = new SmsResult();
        r.success = false;
        r.message = msg;
        r.phoneNumber = phone;
        r.rawResponse = raw;
        return r;
    }
}